import Vue from 'vue'
import VueRouter from 'vue-router'
import Started from '../views/Started'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Started',
    component: Started,
    meta: {
      title: '快速起步'
    }
  },
  {
    path: '/graph',
    name: 'Graph',
    component: () => import('../views/Graph'),
    meta: {
      title: 'Graph 图（基础）'
    }
  },
  {
    path: '/defaultNodes',
    name: 'DefaultNodes',
    component: () => import('../views/DefaultNodes'),
    meta: {
      title: '内置节点'
    }
  },
  {
    path: '/nodeCircle',
    name: 'NodeCircle',
    component: () => import('../views/NodeCircle'),
    meta: {
      title: '节点：圆'
    }
  },
  {
    path: '/defaultEdge',
    name: 'DefaultEdge',
    component: () => import('../views/DefaultEdge'),
    meta: {
      title: '内置边'
    }
  },
  {
    path: '/defaultCombo',
    name: 'DefaultCombo',
    component: () => import('../views/DefaultCombo'),
    meta: {
      title: '内置Combo'
    }
  },
  {
    path: '/layoutGraph',
    name: 'LayoutGraph',
    component: () => import('../views/LayoutGraph'),
    meta: {
      title: '一般图布局'
    }
  },
  {
    path: '/bindEvent',
    name: 'BindEvent',
    component: () => import('../views/BindEvent'),
    meta: {
      title: '监听和绑定事件'
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
